package StudentManagerSystem1;

public class Student {

    //姓名
    private String name;
    //年龄
    private String age;
    //性别
    private String gender;
    //学号
    private String id;
    //家庭住址
    private String address;
    //英语成绩
    private String EnglishScore;
    //语文成绩
    private String ChineseScore;
    //数学成绩
    private String mathScore;
    //总成绩
    private String sumScore;
    //平均成绩
    private String avgScore;


    public Student() {
    }

    public Student(String name, String age, String gender, String id, String address, String ChineseScore, String mathScore, String englishScore, String sumScore, String avgScore) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.id = id;
        this.address = address;
        this.ChineseScore = ChineseScore;
        this.mathScore = mathScore;
        this.EnglishScore = englishScore;
        this.sumScore = sumScore;
        this.avgScore = avgScore;
    }

    //获取平均值
    public String getAvgScore(String chineseScore, String mathScore, String englishScore) {
        int result = 0;
        String[] str = {chineseScore, mathScore, englishScore};
        int chinese = Integer.parseInt(str[0]);
        int math = Integer.parseInt(str[1]);
        int english = Integer.parseInt(str[2]);
        result = (chinese + math + english) / 3;
        return result + "";
    }

    //获取总成绩
    public String getSumScore(String chineseScore, String mathScore, String englishScore) {
        int result = 0;
        String[] str = {chineseScore, mathScore, englishScore};
        int chinese = Integer.parseInt(str[0]);
        int math = Integer.parseInt(str[1]);
        int english = Integer.parseInt(str[2]);
        result = chinese + math + english;
        return result + "";
    }

    /**
     * 获取
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     *
     * @return age
     */
    public String getAge() {
        return age;
    }

    /**
     * 设置
     *
     * @param age
     */
    public void setAge(String age) {
        this.age = age;
    }

    /**
     * 获取
     *
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 设置
     *
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * 获取
     *
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置
     *
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取
     *
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置
     *
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 获取
     *
     * @return EnglishScore
     */
    public String getEnglishScore() {
        return EnglishScore;
    }

    /**
     * 设置
     *
     * @param EnglishScore
     */
    public void setEnglishScore(String EnglishScore) {
        this.EnglishScore = EnglishScore;
    }

    /**
     * 获取
     *
     * @return ChineseScore
     */
    public String getChineseScore() {
        return ChineseScore;
    }

    /**
     * 设置
     *
     * @param ChineseScore
     */
    public void setChineseScore(String ChineseScore) {
        this.ChineseScore = ChineseScore;
    }

    /**
     * 获取
     *
     * @return mathScore
     */
    public String getMathScore() {
        return mathScore;
    }

    /**
     * 设置
     *
     * @param mathScore
     */
    public void setMathScore(String mathScore) {
        this.mathScore = mathScore;
    }

    /**
     * 获取
     *
     * @return sumScore
     */
    public String getSumScore() {
        return sumScore;
    }

    /**
     * 设置
     *
     * @param sumScore
     */
    public void setSumScore(String sumScore) {
        this.sumScore = sumScore;
    }

    /**
     * 获取
     *
     * @return avgScore
     */
    public String getAvgScore() {
        return avgScore;
    }

    /**
     * 设置
     *
     * @param avgScore
     */
    public void setAvgScore(String avgScore) {
        this.avgScore = avgScore;
    }

    public String toString() {
        return (name + "-" + age + "-" + gender + "-" + id + "-" + address + "-" +
                ChineseScore + "-" + mathScore + "-" + EnglishScore + "-" +
                getSumScore(ChineseScore,mathScore,EnglishScore) + "-" + getAvgScore(ChineseScore,mathScore,EnglishScore));
    }
}
